<template>
  <div class="NotFound">
    <h1>页面未发现!{{ delay/1000 }}s后跳转到首页</h1>
  </div>
</template>

<script>
export default {
  name: 'NotFound',
  data() {
    return {
      delay: 3000,
    };
  },
  mounted() {
    const redirect = this.$route.query.redirect;
    console.log(this.$data.msg);
    const numbers = this.$Rx.Observable.timer(this.$data.delay);
    numbers.subscribe({
      next: x => console.log(x),
      error: err => console.error(err),
      complete: () => this.$router.replace(redirect),
    });
  },
};

</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  display: inline-block;
  margin: 0 10px;
}

a {
  color: #42b983;
}
</style>
